package com.java2_23;

public class NeiBuLeiTest {
    private String name;
    private int age;
    public static final int num = 10;
    //成员内部类
    //静态内部类
    public static class Nei{
        public int number = 100;
       public static void show(){
           System.out.println("这是show方法");
       }


    }

    //实例代码块 -- 在创建对象的时候就会优先执行
//    {
//        name = "zhangsan";
//        System.out.println("这是实例代码块的执行");
//    }

    //静态代码块 -- 在加载类的时候执行，并且只执行一次(初始化静态容器)
//    static {
//        System.out.println("这是静态代码块的执行");
//    }
    public NeiBuLeiTest(){

    }

    public NeiBuLeiTest(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return name + " " + age;
    }

    public Nei getNei(){
        return new Nei();
    }
}
